Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic resource cleanup #140

Merged
merged 23 commits into from
Dec 31, 2024
Merged

Add automatic resource cleanup #140

merged 23 commits into from
Dec 31, 2024

Conversation

omrikiei
Copy link
Owner

This PR adds automatic resource cleanup functionality to address issue #134. Changes include:

  • Add ResourceTracker to manage Kubernetes resources lifecycle
  • Add automatic cleanup on process termination (Ctrl+C)
  • Add timeout mechanism for cleanup operations (default 30s)
  • Add comprehensive tests for cleanup functionality
  • Update documentation with cleanup information

The changes ensure that no orphaned resources are left in the cluster after unexpected shutdowns or crashes. The cleanup process is:

  • Automatic: Triggered on process termination
  • Safe: Uses timeouts and concurrent cleanup
  • Transparent: Provides verbose logging
  • Reliable: Covered by comprehensive tests

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

openhands-agent and others added 7 commits December 27, 2024 11:13
- Add ResourceTracker to manage k8s resources lifecycle
- Add automatic cleanup on process termination
- Add timeout mechanism for cleanup operations
- Add tests for cleanup functionality
- Update documentation with cleanup information
- Add workflow to run tests on PRs and master branch
- Include race condition detection
- Add code formatting check
- Add thread-safe client access
- Fix race conditions in cleanup code
- Improve test organization
- Add more test coverage
- Fix boolean comparisons
- Remove unnecessary fmt.Sprintf
- Use fmt.Errorf instead of errors.New(fmt.Sprintf())
- Remove unused code and imports
- Fix variable naming
- Update Go version to 1.21
- Add package comments to cmd package
- Fix variable naming (CPU vs Cpu)
- Fix signal handling (remove SIGKILL)
- Fix error handling and boolean comparisons
- Update deprecated code (io/ioutil, grpc.WithInsecure)
@omrikiei omrikiei force-pushed the add-resource-cleanup branch from fcf32f8 to b3b5a11 Compare December 27, 2024 17:24
omrikiei and others added 2 commits December 27, 2024 11:25
- Replace sync.Once with proper mutex protection
- Add thread-safe access to global variables
- Add proper locking around client operations
- Add proper locking around kubeconfig access
- Add proper locking around verbose flag
@omrikiei omrikiei force-pushed the add-resource-cleanup branch from ebcef7b to 605c0bb Compare December 27, 2024 21:46
@omrikiei omrikiei merged commit 6e4450b into master Dec 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants